<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>账号</title>

    <script charset="utf-8" type="text/javascript" src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script charset="utf-8" type="text/javascript" src="/js/com.wxd.js"></script>
    <script charset="utf-8" type="text/javascript" src="/pageview.js"></script>

    <link rel="stylesheet" type="text/css" href="/style/com.wxd.css"/>
    <link rel="stylesheet" type="text/css" href="/style/table.css"/>

    <style>
        html, body {display: block;width: 100%;height: 100%;overflow: hidden;overflow-x: auto;background: rgb(255, 255, 255);}

        html, body, div, table, tr, td {margin: 0px;border: 0px;box-sizing: border-box;}

        a:link {color: #0866b4;}

        a:visited { color: #0866b4;}

        label {padding-left: 5px;padding-right: 5px;}

    </style>

    <script>
        let pageView;

        function ban(url, uid) {
            let urlQuery = new wxd.Map().loadSearch();
            urlQuery.put("uid", uid);
            wxd.netty.post(url, urlQuery.toString(),
                function (responseText) {
                    wxd.message.alert(
                        JSON.stringify(responseText),
                        "提示：",
                        "关闭",
                        () => {
                            setTimeout(() => {
                                search();
                            }, 1);
                        }
                    );
                },
                (errorMsg) => {
                    wxd.message.alert("异常：" + errorMsg);
                },
                true, 30_000
            );
        }

        function search() {
            wxd.loading();
            let urlQuery = new wxd.Map().loadSearch();
            urlQuery.put("account", $("#account").val());
            urlQuery.put("online", $("#online").val());
            urlQuery.put("rechargeAmount", $("#rechargeAmount").val());
            urlQuery.put("rechargeCount", $("#rechargeCount").val());
            urlQuery.put("other", $("#other").val());
            pageView.remoteGetData(urlQuery);
        }


        function createRow(index, row) {
            let tr = `
    <tr>
        <td tips="true" style="width: 40px;">${index}</td>
        <td tips="true" style="width: 60px;">${row.online}</td>
        <td tips="true" style="width: 200px;">${row.account}</td>
        <td tips="true" style="width: 140px;">${row.createTime}</td>
        <td tips="true" style="width: 70px;">${row.roleCount}<a href="#" style="margin-left: 8px;" onclick="wxd.loadHtml('/log/role/role-sub.html?gameId=${gameId}&account=${row.account}', '98%', '70%'); return false;">查看</a></td>
        <td tips="true" style="width: 100px;">${row.rechargeAmount}</td>
        <td tips="true" style="width: 80px;">${row.rechargeCount}</td>
        <td tips="true" style="width: 140px;">${row.rechargeFirstTime}</td>
        <td tips="true" style="width: 140px;">${row.rechargeLastTime}</td>
        <td tips="true" style="width: 140px;">${row.totalOnlineTime}</td>
        <td tips="true" style="width: 280px;">${row.other}</td>
    </tr>
`;
            return tr;
        }

        let gameId = 0;

        $(() => {
            let urlQuery = new wxd.Map().loadSearch();
            gameId = urlQuery.get("gameId");
            pageView = new PageView("/log/account/list", search, createRow);
            search();
        });

    </script>

</head>

<body>
<div class="btn_box" style="padding-left: 10px; padding-top: 8px; text-align: left;vertical-align: center;">
    <button class="submit" type="button" onclick="search();">搜索</button>
    <label for="minDay">范围日期-开始日期: </label><input id="minDay" type="date"/>
    <label for="maxDay">范围日期-结束日期: </label><input id="maxDay" type="date"/>
    <br>
    <input id="online" type="text" value="" style="" onkeydown="if (event.keyCode===13)search();" placeholder="是否在线，0或者1"/>
    <input id="account" type="text" value="" style="" onkeydown="if (event.keyCode===13)search();" placeholder="账户"/>
    <input id="rechargeAmount" type="text" value="" style="" onkeydown="if (event.keyCode===13)search();" placeholder="充值金额大于等于"/>
    <input id="rechargeCount" type="text" value="" style="" onkeydown="if (event.keyCode===13)search();" placeholder="订单笔数大于等于"/>
    <input id="other" type="text" value="" style="" onkeydown="if (event.keyCode===13)search();" placeholder="a=b"/>
</div>
<div class="tableDom" style="position: absolute;left: 10px;top: 90px;right: 15px;bottom: 35px;">
    <table>
        <thead>
        <tr>
            <th style="width: 40px;">序号</th>
            <th style="width: 60px;">在线</th>
            <th style="width: 200px;">账号</th>
            <th style="width: 140px;">创建时间</th>
            <th style="width: 70px;">角色列表</th>
            <th style="width: 100px;">充值金额</th>
            <th style="width: 80px;">充值笔数</th>
            <th style="width: 140px;">首次充值时间</th>
            <th style="width: 140px;">最后充值时间</th>
            <th style="width: 140px;">累计在线时长</th>
            <th style="width: 280px;">记录</th>
        </tr>
        </thead>
        <tbody>

        </tbody>
    </table>
</div>
</body>
</html>